﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using WebNext.Domain.Entities;

namespace WebNext.DataAccess.Mappings
{
	public abstract class EntityMap<T> : ClassMap<T> where T : Entity
	{
		public EntityMap ()
		{
			this.Id(e => e.Id);
			this.Map(e => e.CreatedBy);
			this.Map(e => e.CreatedOn);
			this.Map(e => e.LastUpdatedBy).Nullable();
			this.Map(e => e.LastUpdatedOn).Nullable();
			this.Version(e => e.Version).UnsavedValue("0");
			this.OptimisticLock.Version();
		}
	}
}
